<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    button.active{
      background: red;
    }
    .content{
      width:200px;
      height:200px;
      border: 1px solid #333;
      font-size: 30px;
      text-align:center;
      line-height: 200px;
    }
  </style>
</head>
<body>
  <div id="app">
    <button @click="tabs(0)" :class="{active:num===0}">1</button>
    <button @click="tabs(1)" :class="{active:num===1}">2</button>
    <button @click="tabs(2)" :class="{active:num===2}">3</button>
    <div v-show="num===0" class="content">1</div>
    <div v-show="num===1" class="content">2</div>
    <div v-show="num===2" class="content">3</div>
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el: "#app",
      data: {
        num: 1
      },
      methods:{
        tabs(n){
          this.num = n;
        }
      }
    })
  </script>
</body>
</html>
